#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

#include "commontypes.h"
#include "aboutwindow.h"
#include "objectwindow.h"

//系统配置
#define MAIN_WINDOW_TITLE "对象检测工具"
#define SYSTEM_VERSION "v1.0"

//关键字
#define KEY_DEFINE      "DEFINE"
#define KEY_OBJECT      "OBJECT"
#define KEY_ELEMENT     "ELEMENT"
#define KEY_TYPE        "TYPE"
#define KEY_LENGTH      "LENGTH"
#define KEY_END         "END"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void initView();

private:
    Ui::MainWindow *ui;
    AboutWindow* m_aboutWindow = nullptr;
    ObjectWindow* m_objectWindow = nullptr;
    DEFINE_LIST m_defineList;
    OBJECT_LIST m_objectList;
    OBJECT_STACK m_objectStack;

private slots:
    void newObjectFile();
    void openObjectFile();
    void closeObjectFile();
    void exitSystem();
    void startObjectCheck();
    void showAboutWindow();
    void blockCountChanged(int newBlockCount);
};
#endif // MAINWINDOW_H
